Skip to content

Remove obsolete OpenAI balance check feature#955

Merged
PeterDaveHello merged 1 commit intoChatGPTBox-dev:masterfrom
PeterDaveHello:remove-openai-balance-button
Mar 15, 2026
Merged

Remove obsolete OpenAI balance check feature#955
PeterDaveHello merged 1 commit intoChatGPTBox-dev:masterfrom
PeterDaveHello:remove-openai-balance-button

Conversation

@PeterDaveHello
Copy link
Copy Markdown
Member

@PeterDaveHello PeterDaveHello commented Mar 15, 2026

Remove the pop-up balance button for OpenAI API mode because it relies on deprecated billing endpoints that no longer return reliable results.

Do not replace it with the newer OpenAI billing APIs for now because that integration requires more complex permissions and architecture changes than this cleanup should take on.

Also, remove the now-unused Balance locale key from all locale files.


Open with Devin

Summary by CodeRabbit

  • Chores
    • Removed Balance feature, including the display interface and translations across all supported languages.

Remove the pop-up balance button for OpenAI API mode because it relies on
deprecated billing endpoints that no longer return reliable results.

Do not replace it with the newer OpenAI billing APIs for now because
that integration requires more complex permissions and architecture
changes than this cleanup should take on.

Also, remove the now-unused Balance locale key from all locale files.
@PeterDaveHello PeterDaveHello requested a review from Copilot March 15, 2026 10:48
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Remove obsolete OpenAI balance check feature and locale strings

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Remove deprecated OpenAI balance check feature relying on obsolete endpoints
• Delete Balance locale key from all 13 language translation files
• Remove checkBilling() and formatDate() helper functions from GeneralPart
• Remove balance state management and related UI button logic
Diagram
flowchart LR
  A["GeneralPart.jsx<br/>Balance Feature"] -->|Remove| B["checkBilling() function"]
  A -->|Remove| C["formatDate() function"]
  A -->|Remove| D["Balance state & UI button"]
  E["Locale Files<br/>13 languages"] -->|Remove| F["Balance translation key"]
Loading

Grey Divider

File Changes

1. src/_locales/de/main.json Localization +0/-1

Remove Balance translation key

src/_locales/de/main.json


2. src/_locales/en/main.json Localization +0/-1

Remove Balance translation key

src/_locales/en/main.json


3. src/_locales/es/main.json Localization +0/-1

Remove Balance translation key

src/_locales/es/main.json


View more (11)
4. src/_locales/fr/main.json Localization +0/-1

Remove Balance translation key

src/_locales/fr/main.json


5. src/_locales/in/main.json Localization +0/-1

Remove Balance translation key

src/_locales/in/main.json


6. src/_locales/it/main.json Localization +0/-1

Remove Balance translation key

src/_locales/it/main.json


7. src/_locales/ja/main.json Localization +0/-1

Remove Balance translation key

src/_locales/ja/main.json


8. src/_locales/ko/main.json Localization +0/-1

Remove Balance translation key

src/_locales/ko/main.json


9. src/_locales/pt/main.json Localization +0/-1

Remove Balance translation key

src/_locales/pt/main.json


10. src/_locales/ru/main.json Localization +0/-1

Remove Balance translation key

src/_locales/ru/main.json


11. src/_locales/tr/main.json Localization +0/-1

Remove Balance translation key

src/_locales/tr/main.json


12. src/_locales/zh-hans/main.json Localization +0/-1

Remove Balance translation key

src/_locales/zh-hans/main.json


13. src/_locales/zh-hant/main.json Localization +0/-1

Remove Balance translation key

src/_locales/zh-hant/main.json


14. src/popup/sections/GeneralPart.jsx 🐞 Bug fix +1/-79

Remove balance check feature and related code

src/popup/sections/GeneralPart.jsx


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review bot commented Mar 15, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Removed Balance locale key 📘 Rule violation ✓ Correctness
Description
The PR removes the existing Balance key from src/_locales/en/main.json, which violates the
repository i18n rule that existing English keys must not be modified. This can break any code paths
(or older extension versions) that still reference t('Balance').
Code

src/_locales/en/main.json[11]

-  "Balance": "Balance",
Evidence
Compliance rule 6 forbids modifying existing keys in the English locale source-of-truth file. The
updated en/main.json no longer contains the Balance key in the modified section, and the PR
description confirms the key was removed.

AGENTS.md
src/_locales/en/main.json[8-13]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR removes the existing `Balance` localization key from `src/_locales/en/main.json`, but repository i18n rules require that existing English keys are not modified.

## Issue Context
Even if the UI no longer shows the balance button, removing an existing key can break any remaining references or older builds that still expect `t(&#x27;Balance&#x27;)`.

## Fix Focus Areas
- src/_locales/en/main.json[8-13]
- src/_locales/de/main.json[8-13]
- src/_locales/es/main.json[8-13]
- src/_locales/fr/main.json[8-13]
- src/_locales/in/main.json[8-13]
- src/_locales/it/main.json[8-13]
- src/_locales/ja/main.json[8-13]
- src/_locales/ko/main.json[8-13]
- src/_locales/pt/main.json[8-13]
- src/_locales/ru/main.json[8-13]
- src/_locales/tr/main.json[8-13]
- src/_locales/zh-hans/main.json[8-13]
- src/_locales/zh-hant/main.json[8-13]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 90d849e0-1c53-41f3-aee5-f705be5b77ff

📥 Commits

Reviewing files that changed from the base of the PR and between fe052ea and ff06c8c.

📒 Files selected for processing (14)
  • src/_locales/de/main.json
  • src/_locales/en/main.json
  • src/_locales/es/main.json
  • src/_locales/fr/main.json
  • src/_locales/in/main.json
  • src/_locales/it/main.json
  • src/_locales/ja/main.json
  • src/_locales/ko/main.json
  • src/_locales/pt/main.json
  • src/_locales/ru/main.json
  • src/_locales/tr/main.json
  • src/_locales/zh-hans/main.json
  • src/_locales/zh-hant/main.json
  • src/popup/sections/GeneralPart.jsx
💤 Files with no reviewable changes (13)
  • src/_locales/en/main.json
  • src/_locales/zh-hant/main.json
  • src/_locales/it/main.json
  • src/_locales/de/main.json
  • src/_locales/fr/main.json
  • src/_locales/zh-hans/main.json
  • src/_locales/es/main.json
  • src/_locales/ko/main.json
  • src/_locales/tr/main.json
  • src/_locales/in/main.json
  • src/_locales/ru/main.json
  • src/_locales/ja/main.json
  • src/_locales/pt/main.json

📝 Walkthrough

Walkthrough

The changes remove the "Balance" translation key from all 13 supported locale files and eliminate balance-related functionality from the GeneralPart component, including state management, helper functions, and UI rendering logic.

Changes

Cohort / File(s) Summary
Locale Translation Removals
src/_locales/de/main.json, src/_locales/en/main.json, src/_locales/es/main.json, src/_locales/fr/main.json, src/_locales/in/main.json, src/_locales/it/main.json, src/_locales/ja/main.json, src/_locales/ko/main.json, src/_locales/pt/main.json, src/_locales/ru/main.json, src/_locales/tr/main.json, src/_locales/zh-hans/main.json, src/_locales/zh-hant/main.json
Removed "Balance" translation key from all locale files across 13 supported languages.
Component Logic Removal
src/popup/sections/GeneralPart.jsx
Removed openUrl import, eliminated formatDate, checkBilling, and getBalance functions, and removed balance state management and UI rendering logic. Balance-related buttons and conditional rendering are now absent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 The balance has hopped away,
From thirteen tongues and one component's display,
No more checking coin or weight,
Just simpler code, a cleaner state—
thump thump

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove obsolete OpenAI balance check feature' accurately describes the main change: removing the deprecated OpenAI balance checking functionality from the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on cleaning up the codebase by eliminating an outdated and non-functional OpenAI balance check feature. The previous implementation used deprecated APIs, leading to unreliable results. By removing this feature and its related components, the PR improves code maintainability and removes unnecessary complexity, without introducing new billing integrations that would require more significant architectural changes.

Highlights

  • Obsolete Feature Removal: The OpenAI balance check feature has been entirely removed from the application due to its reliance on deprecated billing endpoints that no longer provide reliable data.
  • Codebase Cleanup: Associated functions, state management, and UI elements related to the balance check have been deleted, streamlining the GeneralPart.jsx component.
  • Localization Update: The 'Balance' locale key has been removed from all internationalization files, ensuring consistency with the feature's removal.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/_locales/de/main.json
    • Removed the 'Balance' key.
  • src/_locales/en/main.json
    • Removed the 'Balance' key.
  • src/_locales/es/main.json
    • Removed the 'Balance' key.
  • src/_locales/fr/main.json
    • Removed the 'Balance' key.
  • src/_locales/in/main.json
    • Removed the 'Balance' key.
  • src/_locales/it/main.json
    • Removed the 'Balance' key.
  • src/_locales/ja/main.json
    • Removed the 'Balance' key.
  • src/_locales/ko/main.json
    • Removed the 'Balance' key.
  • src/_locales/pt/main.json
    • Removed the 'Balance' key.
  • src/_locales/ru/main.json
    • Removed the 'Balance' key.
  • src/_locales/tr/main.json
    • Removed the 'Balance' key.
  • src/_locales/zh-hans/main.json
    • Removed the 'Balance' key.
  • src/_locales/zh-hant/main.json
    • Removed the 'Balance' key.
  • src/popup/sections/GeneralPart.jsx
    • Removed the 'openUrl' import.
    • Removed the 'formatDate' and 'checkBilling' utility functions.
    • Removed the 'balance' state and 'getBalance' function.
    • Removed the UI button and logic for displaying the OpenAI balance.
Activity
  • No specific activity has been recorded for this pull request yet, indicating a straightforward change.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the OpenAI API “Balance” UI/logic that depended on deprecated/unreliable billing endpoints, and cleans up the now-unused Balance locale key across translations.

Changes:

  • Removes OpenAI billing/balance-fetch logic and related UI from the popup’s general settings section.
  • Deletes the Balance translation key from all locale main.json files.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

File Description
src/popup/sections/GeneralPart.jsx Removes obsolete balance-check helpers/state and the balance button from the OpenAI API key UI.
src/_locales/*/main.json Removes the unused Balance locale key from all supported locales.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the obsolete OpenAI balance check feature. The changes are straightforward, removing the related logic from GeneralPart.jsx and the corresponding translation keys from all locale files. However, it appears that removing the translation keys has introduced a JSON syntax error in all main.json files due to a missing comma on the preceding line. This is a critical issue that will likely break localization. Please see the specific comment for details.

@PeterDaveHello PeterDaveHello merged commit ccd798b into ChatGPTBox-dev:master Mar 15, 2026
8 checks passed
@PeterDaveHello PeterDaveHello deleted the remove-openai-balance-button branch March 15, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants